package cn.qayy.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.qayy.dao.WxClientMapper;
import cn.qayy.dao.WxMailListMapper;
import cn.qayy.dto.MailListDTO;
import cn.qayy.po.WxClient;
import cn.qayy.po.WxMailList;
import cn.qayy.service.IMailListService;
import cn.qayy.utils.DownLoadUtil;

/***
 * @author wy
 *
 */
@SuppressWarnings("all")
@Service("mailListServiceImpl")
public class MailListServiceImpl implements IMailListService {

	@Resource
	public WxMailListMapper wxMailListMapper;

	@Override
	public PageInfo<WxMailList> selectMailListBy(MailListDTO dto) throws Exception {
		if (dto != null) {
			DownLoadUtil.set("MailListDTO",dto);
			PageHelper.startPage(dto.getPageNumber(), dto.getPageSize());
			List<WxMailList> list = wxMailListMapper.selectMailListBy(dto);
			PageInfo<WxMailList> pageInfo = new PageInfo<WxMailList>(list);
			return pageInfo;
		}
		return null;
	}

	
	@Override
	public int insertByList(List list) throws Exception {
		return wxMailListMapper.insertByList(list);
	}

	@Override
	public int updateByList(List list) throws Exception {
		return wxMailListMapper.updateByList(list);
	}

	@Override
	public int deleteByList(List list) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int insert(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(Object bean) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<MailListDTO> selectMailListForDown(Map<String, Object> params) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}


	/*@Override
	public List<WxMailList> selectByMap(Map<String, Object> params) {
		return wxMailListMapper.selectByMap(params);
	}*/

	@Override
	public List<Integer> selectIdsByMap(Map<String, Object> params) {
		return wxMailListMapper.selectIdsByMap(params);
	}


	@Override
	public WxMailList selectMailListByID(Integer gfId) throws Exception {
		return wxMailListMapper.selectByPrimaryKey(gfId);
	}

}
